$(function (){
   app.init()
})

var app = {
   init: function(){
      this.getCaptcha()
      this.captchaImgChage()
   },

   getCaptcha: function (){
      $.get("/admin/captcha?" + Math.random(), function(response){
         console.log(response)
         $("#captchaId").val(response.captchaId)
         $("#captchaImg").attr("src", response.captchaImg)
      })
   },

   captchaImgChage: function (){
      var that = this;
      $("#captchaImg").click(function (){
         that.getCaptcha()
      })
   }
}